package cn.broadmax.boot.modules.jzm.bean;

import cn.broadmax.boot.modules.jzm.entity.JzFileType;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jexx.util.StringUtil;
import lombok.Data;

@Data
@ApiModel(value="分页查询请求", description="日志分页查询")
public class JzFileTypeSearch {

    @ApiModelProperty(value = "案卷类型")
    private String name;


    public static LambdaQueryWrapper<JzFileType> createWrap(JzFileTypeSearch search){
        LambdaQueryWrapper<JzFileType> wrapper = new LambdaQueryWrapper<>();
        if(search != null){
            if(StringUtil.hasText(search.getName())){
                wrapper.like(JzFileType::getName, search.getName());
            }
        }
        wrapper.orderByDesc(JzFileType::getCreateTime);
        return wrapper;
    }

}
